package com.jy.servlet;

import com.alibaba.fastjson.JSON;
import com.jy.bean.Order_browse;
import com.jy.dao.OrderDao;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

public class orderDetail_payWeixin extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String order_number =request.getParameter("order_number");

        Integer order_money = 0;
        List<Order_browse> browses = OrderDao.selectByOrdernumberprices(order_number);
        for (Order_browse browse:browses){
            order_money = browse.getPrices();
        }

        HttpSession session = request.getSession();
        session.setAttribute("order_form",order_number);
        session.setAttribute("order_money",order_money);
        request.getRequestDispatcher("/payWeixin.jsp").forward(request,response);
    }
}
